package com.cloud.pole.param.biz;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ace.cache.annotation.Cache;
import com.ace.cache.annotation.CacheClear;
import com.cloud.pole.common.biz.BaseBiz;
import com.cloud.pole.mapper.ParameterMapper;
import com.cloud.pole.param.model.entity.Parameter;

/**
 * 
* <p>Title: ParameterBiz</p>  
* <p>Description: </p>  
* @author hsg  
* @date 2019年1月17日
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class ParameterBiz extends BaseBiz<ParameterMapper,Parameter> {

    @Override
    @CacheClear(pre="parameter{1.settingKey}")
    public void insert(Parameter entity) {
        mapper.insert(entity);
    }

    @Override
    @CacheClear(pre="parameter{1.settingKey}")
    public void insertSelective(Parameter entity) {
        mapper.insertSelective(entity);
    }
    
    @Override
    @CacheClear(pre="parameter{1.settingKey}")
    public void updateById(Parameter entity) {
        super.updateById(entity);
    }

    @Override
    @CacheClear(pre="parameter{1.settingKey}")
    public void updateSelectiveById(Parameter entity) {
        super.updateSelectiveById(entity);
    }
    
    /**
	 * 
	 * <p>Title: selectPicklistByCode</p>  
	 * <p>Description: 根据字典编码查询指定数据字典列表</p>  
	 * @param picklistCode 字典编码
	 * @return 数据字典列表
	 */
    @Cache(key = "parameter{1}")
    public Parameter getParameterByKey(String settingKey){
        return mapper.selectParameterByKey(settingKey);
    }
}
